Output cam system and method

ABSTRACT

A position of a motion control axis is monitored and an output device responsive to the position of the motion control axis is controlled. The controlling further includes latching an electronic cam element that controls the output device, and unlatching the cam element that controls the output device. The manner in which the latching is performed and the manner in which the unlatching is performed are configurable in a programming interface. The programming interface is capable of receiving a latch position for the cam element and an unlatch position for the cam element. The programming interface is further capable of receiving additional configuration information to configure the manner in which the latching is performed and different additional configuration information to separately configure the manner in which the unlatching is performed.

CROSS REFERENCE TO RELATED APPLICATION

This application is a continuation of U.S. Ser. No. 10/175,518, now U.S.Pat. No. 7,099,719, filed Jun. 19, 2002, entitled “Output Cam System andMethod,” hereby incorporated by reference in its entirety.

BACKGROUND

Cam systems are used in a wide variety of different systems to controloutput devices. For example, in industrial control systems, cam systemsare commonly used to control the operation of one or more output devicesresponsive to the operation of one or more other devices. For example,in one configuration cam systems are used to control output devicesresponsive to the operation of a motor. In such a configuration, the camsystem may be used to synchronize the operation of the output devices tothe operation of the motor, such that the output devices assumedifferent output states in accordance with the real time position of themotor shaft. Therefore, for example, as a product moves on a conveyorbelt, a cam system may be used to control the output devices responsiveto motor position so as to cause certain actions to be taken atpredetermined locations along the conveyor belt. Rather than use motorposition as the motion control axis, another motion control axis mayalso be used, such as an axis more directly associated with the devicedriven by the motor. Other configurations are also possible.

Early cam systems were mechanically implemented, such as a camshaft usedin an internal combustion engine system. With the development of digitalsignal processing technology, including microprocessor technology, camsystems are now widely electronically implemented. Electronicimplementation of cam systems is advantageous because it allows morecomplex relationships between a larger number of devices to be defined.However, as the complexity of cam systems increases, there is anincreased need for improved cam systems and related programming toolsthat are easy to use, flexible, and/or capable of allowing increasinglycomplex relationships to be defined and monitored. Output cam systemsand methods that preferably meet one or more of these needs would behighly advantageous.

SUMMARY OF THE INVENTION

In accordance with an embodiment, a control method comprises monitoringa position of a motion control axis and controlling an output deviceresponsive to the position of the motion control axis. The controllingstep further includes latching an electronic cam element that controlsthe output device, and unlatching the cam element that controls theoutput device. The manner in which the latching step is performed andthe manner in which the unlatching step is performed are configurable ina programming interface. The programming interface is capable ofreceiving a latch position for the cam element and an unlatch positionfor the cam element. The programming interface is further capable ofreceiving additional configuration information to configure the mannerin which the latching step is performed and different additionalconfiguration information to separately configure the manner in whichthe unlatching step is performed. The latching step and the unlatchingstep are performed in the manner configured in the programminginterface.

Other embodiments and features of the present invention will becomeapparent to those skilled in the art from the following detaileddescription and accompanying drawings. It should be understood, however,that the detailed description and specific examples, while indicatingpreferred embodiments of the present invention, are given by way ofillustration and not limitation. Many modifications and changes withinthe scope of the present invention may be made without departing fromthe spirit thereof, and the invention includes all such modifications.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a functional block diagram showing building blocks usable toprogram a motion control system;

FIG. 2 is an embodiment motion control system in which output camfunctionality is provided in a controller module;

FIG. 3 shows control of an output device responsive to axis position;

FIG. 4 is an embodiment of a motion control system in which output camcontrol logic is provided in an output cam module;

FIG. 5 is an embodiment of a motion control system in which output camcontrol logic is provided in a motion control module;

FIG. 6 is an embodiment of a motion control system in which output camcontrol logic is provided in an output device;

FIG. 7 is an embodiment of a motion control system in which output camcontrol logic is provided in a PC-based controller;

FIG. 8 is an arm output cam instruction usable to program control logicin the motion control systems of FIGS. 2 and 4-7;

FIG. 9 is a disarm output cam instruction usable to program controllogic the motion control systems of FIGS. 2 and 4-7;

FIG. 10 shows operation of an axis arm position operand and a cam armposition operation of the output cam instruction of FIG. 8;

FIG. 11 shows relationships between the axis, input, and output that aredefined by an output cam element;

FIG. 12 shows the effect of a selected latch type on an output bit fordifferent compensated cam and enable bit combinations as function ofposition;

FIG. 13 shows the effect of a selected unlatch type on an output bit fordifferent compensated cam and enable bit combinations as function ofposition;

FIG. 14 shows the effect of a selected unlatch type on an output bit fordifferent compensated cam and enable bit combinations as a function oftime;

FIG. 15 shows the effect of output compensation on the relationshipsbetween the axis, input, and output;

FIG. 16 shows the effect of compensation values on an output camelement;

FIG. 17 shows the effect of the mode, cycle time, and duty cycle on anoutput bit;

FIG. 18 shows operation of overlapping cam elements being combined toproduce an extended output cam; and

FIG. 19 is a user interface of a graphical output cam editor.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

Various preferred embodiments of the invention will now be described.Although the invention is described by way of example in the context ofan industrial control system, it will be appreciated that the inventionmay be employed in other types of systems as well.

A. System Architecture

Referring now to the Figures, FIG. 1 is a functional block diagramshowing building blocks embodied in a programming interface usable toprogram a motion control system 10. The building blocks include a motioncontrol axis block 12, one or more output cam blocks 14, one or moreoutput blocks 16, and a plurality of motion control blocks 18. Themotion control blocks 18 further include a jog block 22, a move block24, a time cam block 26, a gear block 28, and a position cam block 30.The building blocks 12-18 may be used for programming a wide variety ofpractical motion control systems. Therefore, although only one of eachof the building blocks 12-18 is shown, it will be appreciated that thisconfiguration is purely for purposes of explanation and that practicalsystems are likely to have a configuration different than that shown inFIG. 1, typically with many additional ones of the building blocks12-18. Fewer, more, or different building blocks may also be used.

In one embodiment, the building blocks 12-18 are implemented usingobjects in an object-oriented programming language. Thus, the axis block12 may be implemented using an object having services that may beinvoked using one or more axis instructions, and the output cam block(s)14 may be implemented using an object having services that may beinvoked using one or more output cam instructions. Further, each of themotion blocks 18 may be implemented using objects (e.g., a jog object, amove object, a time cam object, a gear object, and a position camobject) having services that may be invoked using one or more respectiveinstructions (e.g., a jog instruction, a move instruction, a time caminstruction, a gear instruction, and a position cam instruction). Indesigning such a system, a new instance of the axis object may becreated to represent a motion control axis (e.g., an electric motor, ashaft or other device driven by an electric motor, and so on). Newinstances of the output cam object may be created to represent newoutput cams. An axis instruction may then be incorporated in the userprogram to invoke the services of one of the axis objects, an output caminstruction may be incorporated into the user program to invoke theservices of the output cam object, and so on. The axis and output caminstructions may then be executed by a microprocessor-based controlunit, for example, to control movement of the motion control axis and tocontrol one or more output devices responsive (directly or indirectly)to a position (e.g., absolute position, relative position, deltaposition, etc.) of the motion control axis, respectively. If anobject-oriented approach is used, the axis instruction controls movementof the motion control axis by utilizing the services of the axis object,and the output cam instruction controls the state of one or more outputdevices by utilizing the services of an output cam object. Of course, itshould be understood that these features, and all of the other featuresdescribed herein, may also be implemented without using object-orientedtechniques.

Referring now also to FIG. 2, FIG. 2 shows one embodiment of a hardwareimplementation of the motion control system 10 described by the blockdiagram of FIG. 1. From a hardware perspective, the motion controlsystem 10 comprises a controller module 40, a servo drive 42, a motor44, a feedback device 46, an I/O module 48, and one or more outputdevices 50. The modules 40 and 48 may, for example, be a controllermodule and an output module, respectively, of a rack-mountedprogrammable controller system. The feedback device 46 may, for example,be an encoder. The axis block 12 is control logic that is stored andexecuted in the controller module 40 and that is used to control themotor 44. If a programmable controller system is used, the axis block 12may also be stored and executed in a separate motion control modulerather than being embedded in the controller module 40.

The axis block 12 controls the motor 44 responsive to inputs from thejog block 18, the move block 20, the time cam block 22, the gear block24, and the position cam block 28. The jog block 18 permits the user(via a jog instruction) to specify a new velocity at which the shaft ofthe motor 44 is to move. The move block 20 permits the user (via a moveinstruction) to specify a new position for the shaft of the motor 44.The time cam block 26 permits the user (via a time cam instruction) tospecify an axis position profile which specifies axis position as afunction of time. The gear cam block 28 permits the user (via a gearinstruction) to specify an electronic gearing relationship between theshaft of the motor 44 and the shaft of another motor (not shown) in thesystem 10. The position cam block 26 permits the user (via a positioncam instruction) to specify an axis position profile which specifiesaxis position for the shaft of the motor 44 as a function of a positionof the shaft of another motor (not shown) in the system 10. In the caseof the gear block 28 and the position cam block 30, it will beappreciated that these blocks will receive inputs from other axis blockssimilar to the axis block 12, which may in turn receive inputs frommotion blocks similar to the motion blocks 18. It is therefore seen thatthe complexity of the motion control system 10 can be increased byproviding multiple axes (and therefore multiple motors or other devices)and defining various relationships between the axes. Also, as describedbelow, the number of output cam blocks 14 is not limited in any way.Other blocks, objects, and instructions may also be used.

As shown in FIG. 2, the axis block 12 provides a control signal to theservo drive 42, which is operative to control the motor 44 in accordancewith the control signal. For example, the control signal may be avelocity reference signal, and the servo drive 42 may be operative tocontrol the speed of the motor 44 so as to track the motor speedcommanded by the velocity reference signal provided by the axis block12. The position of the motor 44 is monitored by the feedback device 46which provides feedback information to the axis block 12. Alternatively,the feedback device 46 may be used to monitor the position of a devicedriven by the motor 44.

The axis block 12 is coupled to the output cam blocks 14, which are inturn are coupled by way of the output blocks 16 to the output devices50. Each output cam block 14 comprises control logic that is stored andexecuted in the controller module 40 (or other microprocessor-basedcontrol unit) and that is used to control output states of the outputdevices 50. The output block 16 may, for example, be a bit in memorythat represents the desired output state of one of the output devices50. The output module 48 may comprise one or more output circuits (notshown) coupled between the bits in memory and the output devices 50. Theoutput cam block 14 is operative to receive information regarding motorposition from the feedback device 46, and use the position informationto control the output states of the output devices 50 in a predeterminedmanner. Typically, the operation of the output devices 50 will at leastto some extent be cyclic, and the output cam block 14 synchronizes theoperation of the output devices 50 to rotation of the shaft of the motor44 (or to movement of a device driven by the shaft of the motor 44).Control of one output device 50 responsive to axis position is shown inFIG. 3. FIG. 3 shows a cam profile comprising two cam elements thatcontrol an output device 50. This relationship can be viewed as amaster/slave relationship with the axis 12 representing the master andthe output block 16 representing the slave.

In practice, each output cam block 14 is responsible for one outputblock 16, which may comprise a predetermined number of output bits, suchas thirty-two output bits. As will be described below, each singleoutput bit can be programmed separately with an output cam profile, andcompensated for position offset and time delay. Therefore, each outputblock 16 may be connected to thirty-two different output devices 50.

Also shown are input devices 54 and additional output devices 56. TheI/O devices 54 and 56 are coupled to the I/O module 48, but are notcontrolled by any output cam block 14. Thus, the output cam block 14 iscapable of implementing output cam control over output devices 50 thatare connected to the same I/O module 48 as other output devices 56 inthe system.

A variety of techniques may be used to transmit control signals to theoutput device 50 in response to output cam processing by the output camblock 14. In one configuration, the controller module 40 maintains anI/O image table for each of the input/output devices to which it isconnected. When the output cam block 14 determines that the outputdevice 50 should be turned on, the output cam block 14 turns on a bit inthe I/O image table, and the controller module 40 sends a message by wayof a communication network 47 to the I/O module 48 to cause the outputdevice 50 to turn on. The communication network 47 may, for example, bea network implemented using a back plane of a rack that houses themodules 40 and 52, a remote I/O network, or other suitable network. Inthis regard, it may be noted that the output cam block 14 is embedded inthe controller module 40, which also controls the other output devices56 that are not controlled using output cam functionality. The otheroutput devices 56 may be connected to the I/O module 48 or to otheroutput modules that operate under the control of the controller module40. Therefore, when the message is sent from the controller module 40 tothe I/O module 48 that causes the output device 50 to change state, thisstate change message is typically sent as part of a larger message thatalso includes control signals for the other output devices 56 connectedto the I/O module 48. Typically, in some existing programmablecontroller systems, I/O messages are sent between a controller moduleand an output module once per update cycle, which is typically in arange of milliseconds to tens of milliseconds. Therefore, assuming amessage of this type is used in the configuration of FIG. 2, then thetiming accuracy with which one of the output devices 50 can becontrolled is determined by the course update period and, in thisexample, is in the milliseconds to tens of milliseconds range.

In another embodiment, in order to improve accuracy, the controllermodule 40 sends the I/O module 48 a state change scheduling message toschedule when one of the output devices 50 should be turned on and off,and the I/O module 48 is responsible for controlling the precise instantat which the output device 50 changes state. In this configuration, themessage that is sent to the I/O module 48 includes a time stamp thatinstructs the I/O module 48 when to change the state of the outputdevice 50. The controller module 40 and the I/O module 48 have a commonunderstanding of time, that is, their clocks are synchronized with ahigh degree of accuracy. In one configuration, the I/O module 48 furthersubdivides the update cycle into sub-update cycles, and the output camoperation is assigned to be performed during one of the sub-updatecycles in accordance with the time stamp (that is, the operation isassigned to a time slot best representing its relative desired positionwithin the update cycle). This allows the I/O module 48 to change thestate of the output device 50 between I/O messages from the controllermodule 40. This also allows multiple cam events for a single outputdevice 50 to be processed each update cycle, because each event can beassigned to an appropriate sub-update period. In this configuration,using current programmable controller technology, the output module 50is able to change the state of the output device 50 to an accuracy inthe range of tens to hundreds of microseconds.

Referring now to FIG. 4, in another embodiment, the output cam block 14is located in an output cam module 52. The output cam module 52 may beconstructed in a manner that is similar to the I/O module 48, althoughit may include a more powerful microprocessor and larger memory thanwould otherwise typically be employed in order to provide sufficientprocessing power to store and process the control logic that implementsthe output cam block 14. The output cam module 52 receives a feedbacksignal directly from the feedback device 46, or a separate feedbackdevice may be provided which is dedicated for use by the output cammodule 52. If the feedback signal is received directly from the feedbackdevice 46, the feedback signal may either be shared with the controllermodule 40, or the output cam module 48 may receive the feedback signalbut then digitally relay the feedback information back to the controllermodule 40. The output block 16 is also located in the output cam module52, and is used to connect the output cam module 52 to the outputdevices 50. In this configuration, the control signals used to controlthe output devices 50 are generated at the output cam module 52, whichcontrols the state of the output devices 50 based on the positioninformation pertaining to the motion control axis from the feedbackdevice 46. Accordingly, flexibility exists to control the output devices50 without regard to the fixed update cycles of the controller modules48 and without the need to transmit control signals over thecommunication network 47. Accordingly, using current programmablecontroller technology, the output cam module 52 is able to change thestate of the output device 50 to an accuracy in the range of, forexample, about five to fifty microseconds. In another configuration, theoutput cam module 52 supports multiple output cam blocks 14 per motionaxis. In this case, the output cam module 52 connects to a separate I/Omodule of the type shown as I/O module 48 in FIG. 2. This optionprovides capability to control additional output devices 50 at aperformance level between execution by the controller module 40 andexecution by the output module 52.

The output cam module 52 provides input and output updates through thestandard I/O connection. As a result, the inputs and outputs are readilyavailable for user access in a manner similar to the one of the outputmodule 48.

In the preferred embodiment, therefore, the output cam block 14 is fullyintegrated into the motion control system 10. The output caminstructions (described below) associated with the output cam block 14may be in the same user program as the axis motion control instructionsassociated with the axis block 12 and the motion blocks 18. Each ofthese instructions may be, for example, instructions available to a userin a common ladder logic programming language. Therefore, a singleprogramming interface on a single computer may be used to program theaxis block 12 (along with the motion blocks 18) and the output cam block14. It is not necessary to program the axis block 12 and the output camblock 14 using two unrelated different programming interfaces ondifferent computers. This also facilitates troubleshooting, because theoperation of the axis block 12 and the motion blocks 18 preferably canbe monitored and debugged simultaneously with the operation of theoutput cam block 14 and the output devices 50, and because theprogramming interface that is used to program the blocks 12-18preferably resides on a single computer. Monitoring and debugging arealso simplified because the output cam logic preferably operates in acommon time reference as the axis motion control logic.

Additionally, integration of the output cam block 14 into the motioncontrol system 10 facilitates coordinating arming and disarming of anoutput cam with the same control logic that controls the motion controlaxis. Therefore, there is no need to transmit messages back and forthbetween two separate pieces of control logic. This results in an abilityto time output cam arming and disarming more accurately and in a mannerwhich is more responsive to system conditions. Likewise, compensation ofcamming operations is easier to adjust during execution of the userprogram. The current position of the motion control axis may bemonitored and adjustments in compensation may be timed more accurately.

Further, it may be noted that the block diagram of FIG. 1 may beimplemented using either the architecture of FIG. 2 (including both thenormal I/O messaging and the I/O scheduling variations) or thearchitecture of FIG. 4, and this provides significant benefits to theuser. The user may program the system 10 without necessarily knowingwhether it will be possible to place the output cam block 14 in thecontroller module 40, or whether the timing accuracy required by aparticular application will be sufficiently high that the dedicatedoutput cam module 52 will be needed. Therefore, a user may program theentire system 10, determine whether the configuration of FIG. 2 issufficient and, if it is not sufficient, then adopt the configuration ofFIG. 4. As will be detailed below, the change in hardware is generallytransparent to the user from a programming standpoint, except that asetting in the output cam instructions (discussed below) is adjusted toreflect the change.

Moreover, it may be noted that the arrangement shown is readilyscalable. Although the motion control system of FIG. 1 is shown with asingle output cam block 14 receiving an input from the axis block 12,additional output cam blocks 14 can also be configured to receive aninput from the axis block 12. From a system architecture standpoint,there is no limitation on the number of output cam blocks 14 that may becoupled to an axis block 12, and therefore no limitation on the numberof output devices 50 that may be controlled, except of course thatadditional hardware may be needed.

Finally, the arrangement shown is integrated from a data standpoint, andthis results in minimal hardware. In the embodiment of FIG. 4, forexample, there is no need to provide one position feedback device forthe controller module 40 and another position feedback device for theoutput cam module 48. The position information obtained by the feedbackdevice 46 is used not only by the output cam block 14, but also by theaxis block 12. This information is provided to the controller module 40,and can be used in other parts of the system 10. There is no need formultiple feedback devices to monitor the same axis for different controlsystems. Additionally, I/O status data may be shared between all partsof the system 10, such that the output cam blocks 14 may have access toI/O status data from other parts of the system 10, and blocks in otherparts of the system 10 may have access to I/O status data from theoutput cam blocks 14 and/or the output blocks 16.

Referring now to FIGS. 5-7, a number of additional hardwareimplementations are shown that also share each of the same featuresdescribed above in connection with the embodiments of FIGS. 2 and 4.FIG. 5 shows an implementation that embodies a distributed controldesign philosophy. In the embodiment of FIG. 5, the axis block 12 andthe output cam block 14 are both provided in a motion control module 60,which is operative to control the motor 44, to receive inputs from theinput devices 54, and to control the output devices 50 and 56. Thecontrol module 60 includes I/O ports to which input/output devices 50,54, and 56 can be connected. The motor 44 may be controlled as specifiedby one or more motion control instructions (e.g., jog, move, time cam,gear, or position cam instructions) as described above in connectionwith FIG. 2. The motion control module 60 maintains an I/O image tableof the type discussed above in connection with the controller module 40.The motion control module 60 is coupled to other similarly configuredmotion control modules 62, which are also coupled to input devices,output devices, and motors. The output cam block 14 controls the outputdevices 50 responsive to the position of the motor 44 or other motioncontrol axis, as previously described. I/O status information for theinput device 54 and the output devices 50 and 56 is transmitted to themodules 62 over a communication network 63.

FIG. 6 shows another implementation that also embodies a distributedcontrol design philosophy. In the embodiment of FIG. 6, the servo drive42, the feedback device 46, and the control logic associated with theaxis block are integrated into the motor 44. Additionally, the controllogic associated with the output cam block 14 and the output block 16are integrated into the output device 50. The motor 44 and the outputdevice 50 are therefore each provided with a suitable microprocessor andmemory to store and process the control logic. The motor 44 may becontrolled as specified by one or more motion control instructions(e.g., jog, move, time cam, gear, or position cam instructions) asdescribed above in connection with FIG. 2. The motion controlinstructions may be executed at the motor 44, for example. The outputdevice may, for example, be an electromechanical actuator. The outputdevice 50 includes the output cam block 14, receives positioninformation from the motor 44, and performs the output cam control logicon the position information. The output cam block 14 controls the outputdevice 50 responsive to the position of the motor 44 or other motioncontrol axis, as previously described. The output device 50 maintains atleast a portion of an I/O image table of the type discussed above inconnection with the controller module 40. Other similarly configuredmotors and output devices may be provided, and I/O status informationmay be transmitted between each of these devices.

FIG. 7 shows another implementation in which the axis block 12, theoutput cam block 14, and the output block 16 are provided in amicroprocessor-based control unit 70, which may for example be apersonal computer based or other embedded controller. The motor 44 maybe controlled as specified by one or more motion control instructions(e.g., jog, move, time cam, gear, or position cam instructions) asdescribed above in connection with FIG. 2. The motion controlinstructions may be executed at the controller 70, for example. Theoutput cam block 14 controls the output device 50 responsive to theposition of the motor 44 or other motion control axis, as previouslydescribed. The output device 50 maintains at least a portion of an I/Oimage table of the type discussed above in connection with thecontroller module 40. Other similarly configured controllers 70 may beprovided, and I/O status information may be transmitted between each ofthese devices. Of course, each of the above embodiments of FIGS. 2 and4-7 could also be used in combination.

B. Output Cam Programming

1. Instructions

Referring now to FIG. 8-9, as mentioned above, camming operations areachieved through the use of one or more output cam instructions. Theoutput cam instructions are part of the same programming language (e.g.,a ladder logic programming language) as the instructions used inconnection with the axis block 12 and the motion blocks 18, and arecapable of being used in the same user program as the axis and motioninstructions. The output cam instructions control the manner in whichcamming operations are performed.

In the preferred embodiment, the output cam instructions comprise twoinstructions: an arm output cam instruction 110 (FIG. 8) and a disarmoutput cam instruction 150 (FIG. 9). The arm output cam instruction 110is used to initiate the arming of an output cam between a specified axisand the output devices 50, and the disarm output cam instruction 150 isused to terminate the output cam.

If an object oriented approach is used, then in addition to the servicesthat objects available in an object-oriented programming interfacetypically offer (create instance, delete instance, etc.), the output camobject preferably offers an arm service, an update service, and a disarmservice. The arm service is invoked by the arm output cam instruction110, and details of this service will become apparent from thediscussion of the details of the arm output cam instruction 110, below.Executing the arm output cam instruction 110 is sometimes referred toherein as initiating an output cam. The update service is invoked afterthe arm output cam instruction 110 has been executed and before thedisarm output cam instruction 150 has been executed. The update serviceis invoked at regular update cycles, and is responsible for performinglatch and unlatch operations at each update cycle. The disarm service isinvoked by the disarm output cam instruction 150, and details of thisservice will become apparent from the discussion of the details of thedisarm output cam instruction 150, below. Executing the disarm outputcam instruction 150 is sometimes referred to herein as terminating anoutput cam. The arm output cam instruction 110 is then executable tocontrol one or more output devices responsive (directly or indirectly)to a position (e.g., absolute position, relative position, deltaposition, etc.) of the motion control axis. In the context of anobject-oriented environment, this occurs by virtue of the arm output caminstruction 110 utilizing the arm and update services of an output camobject. The attributes of the output cam object may indicate, forexample, whether an output cam has been initiated, whether an output camis pending, whether an output cam position is locked to another axissuch as a master axis, and whether an output cam is transitioningbetween pending status and active status.

FIG. 8 shows the arm output cam instruction 110 as it appears to theprogrammer in one embodiment in which the output cam instruction is aninstruction in a ladder logic programming language. In the preferredembodiment, as shown in FIG. 8, the arm output cam instruction 110includes the following operands: an axis operand 112, an executiontarget operand 114, a motion control operand 116, an output operand 118,an input operand 120, an output cam operand 122, a cam start positionoperand 124, a cam end position operand 126, an output compensationoperand 128, an execution mode operand 130, an execution scheduleoperand 132, an axis arm position operand 134, a cam arm positionoperand 136, and a reference operand 138. As described below, theoperands 112-138 are used to specify user-configurable parameters thatconfigure the output cam initiated by execution of the arm output caminstruction 110. These operands will now be described in greater detail.

The axis operand 112 specifies the position input to the output cam. Aspreviously indicated, there may be multiple axis blocks 12 in the motioncontrol system 10, and the purpose of the axis operand 112 is to specifywhich one of the axis blocks 12 is to be used as; a position input tothe output cam. If the output cam instruction 110 is to be executed bythe controller module 40, the axis operand 112 can be assigned to be aservo, feedback only, virtual, or consumed axis. If servo axis isselected, the axis block 12 corresponds to a servo drive, motor and/orload, and feedback device of the type shown with reference numbers 42,44, 45 and 46 in FIGS. 2-7. If feedback only axis is selected, the axisblock 12 corresponds to a feedback device of the type shown withreference number 46 in FIGS. 2-7. If virtual or consumed axis isselected, the axis block does not correspond to any particular hardware,but is an axis that is represented internally to facilitate programmingthe system 10. In the case of a virtual axis, position values for thevirtual axis are internally generated by the control logic thatimplements the virtual axis block. Typically, multiple gear blocks (suchas the gear block 28) and/or multiple position cam blocks (such as theposition cam block 30) are coupled to receive the position informationfrom the virtual axis as an input, and to provide an output to anotheraxis block based on the position information from the virtual axis. Thisallows multiple axes to be synchronized to a common source of positionreference values. In the case of a consumed axis, position values forthe consumed axis are generated by a motion control unit which istypically not integrated with the remainder of the system 10 (e.g.,where the two systems are provided by different manufacturers). In thiscase, position information for the motion control axis controlled by themotion control unit may be transmitted over a network to the controllermodule 40, and the controller module 40 then consumes the positioninformation from the non-integrated motion control unit. The position ofthe motion controlled axis controlled by the non-integrated motioncontrol unit is then represented using a consumed axis.

The ability to support multiple axis types is advantageous. For example,because the servo axis is supported, the output cam block 14 can utilizecommanded position values for position information rather than feedbackinformation from the feedback device 44. Also, the ability to specifyservo axis avoids the need to specify feedback only (and thus avoids theneed for additional hardware) in some instances. Moreover, because thefeedback only axis type is also supported, the output cam instruction110 can be executed by the output cam module 52, which receives positionfeedback from the motor 44 but does not control the motor 44. Thus, ifthe output cam instruction 110 is to be executed by the output cammodule 52, the axis operand 112 may be assigned to be a feedback onlyaxis and to an axis assigned to the output cam module 52. Further,because the virtual axis is supported, the output cam block 14 may besynchronized to the same common source of position reference values asused by axis blocks of the system 10.

The execution target operand 114 specifies a specific output cam fromthe set that is connected to the axis specified by the axis operand 112.As previously indicated, there may be multiple axis blocks 12 in themotion control system 10 and, for each of the axis blocks 12, there maybe one or more output cam blocks 14. The purpose of the execution targetoperand 114 is to specify which one of the output cam blocks 14 is,toexecute the arm output cam instruction 110. Of course, the output camblock 14 specified by the operand 114 should be connected to the axisblock specified by the operand 112. Based on the value assigned theexecution target operand 114, the output cam block 14 may either be anoutput cam block that is implemented using control logic that isexecuted in the controller module 40 or an output cam block that isimplemented using control logic that is executed in the output cammodule 52. Alternatively, the execution target operand 114 may specifyan output cam block that is implemented using control logic that isexecuted in the motion control module 60 of FIG. 5, the actuator 50 ofFIG. 6, or the controller 70 of FIG. 7, if one or more of theembodiments of FIGS. 5-7 is employed.

The motion control operand 116 stores status information duringexecution of the arm output cam instruction. This information includeswhether execution is in process, error information, and so on. Theoperand is another variable in the system 10 that can be examined byother parts of a user program used to provide initiation and run-timestatus information as the arm output cam instruction 110 executes.

The output operand 118 is a predetermined number (e.g., thirty-two) ofoutput bits that can be set and reset depending on the specified outputcam. As previously indicated, each output cam block 14 is responsiblefor one output block 16, which comprises a predetermined number (e.g.,thirty-two) of output bits, which can be a memory location or a physicalactuator output. The output operand 118 specifies which outputbit/device is to be affected by the execution of the arm output caminstruction 110.

The input operand 120 is a predetermined number (e.g., thirty-two) ofinput bits that can be used as enable bits to control operation of thespecified output cam. As will be described below, thelatching/unlatching of an output device 50 may be controlled using anenable bit as an input. The input operand 120 permits the input bit thatis to be used as an enable bit to be specified. The input can be eithera memory location or a physical input from a sensor or other device.

The output cam operand 122 is an array of output cam elements thatallows the latch/unlatch behavior of an output bit/device to beconfigured. A cam element comprises a latch/unlatch combination for anoutput bit. The number of cams per output bit/device defines the size ofthis array. For execution by the controller module 40, the array size islimited by the available memory of the controller module 40. Forexecution by the output cam module 52, the array size is limited by theavailable memory of the output cam module 52. For execution by thecontroller module 40, changes to the output cam will take effectimmediately. For execution by the output cam module 52, changes to theoutput cam takes effect at the execution of an arm output caminstruction 110. The output cam operand 122 is described in greaterdetail below.

The cam start position operand 124 and cam end position operand 126define the left and right boundary of the output cam range. When the camposition moves beyond the cam start or cam end position, the behavior ofthe output cam is defined by the execution mode operand 130 and theexecution schedule operand 132, described below. Changes to the camstart or cam end position take effect at the execution of the arm outputcam instruction 110.

Preferably, the cam start position and the cam end position may bespecified using floating point numbers. The use of floating pointnumbers is advantageous because it increases the range of values thatmay be represented, and allows the resolution of the numbers to beautomatically re-scaled depending on the exponent. The use of floatingpoint values allows values to be specified with precision regardless ofmotor speed. Also in the preferred embodiment, the cam start positionand the cam end position may be specified in terms of “user units.” Fordistance, for example, a user unit may be the length of one package.This avoids the need for the user to specify distance in terms ofencoder counts, for example, which may be less intuitive for the user.Preferably, floating point values and user units are used wherevertime/distance values are specified.

The output compensation operand 128 is an array of output compensationelements. The array indices correspond to the output bit numbers. Thenumber of the highest compensated output bit defines the minimum size ofthis array. In the case of execution by the controller module 40,changes to the output compensation will take effect immediately. In thecase of execution by the output cam module 52 changes to the outputcompensation will only take effect at the execution of the arm outputcam instruction 110. The output compensation operand 128 is described ingreater detail below.

The execution mode operand 130 allows the execution mode to be selected.Depending on the selected execution mode, the output cam behavior maydiffer, when the cam position moves beyond the cam start or cam endposition. The available execution modes include the following modes:once, continuous, and persistent. For the once mode, after the camposition moves beyond the cam start or cam end position, the output camis disarmed and the process complete bit of the motion instruction isset. For the continuous execution mode, after the cam position movesbeyond the cam start or cam end position, the output cam continues onthe opposite side of the output cam range. For the persistent executionmode, after the cam position moves beyond the cam start or cam endposition, the output cam is disarmed. However, when the cam positionmoves back into the output cam range the output cam is rearmed.Persistent mode therefore provides support for machine motion whichmoves in one direction, stops, then moves in the reverse directionperforming the same operations in both directions. Thus, the arm outputcam instruction 110 provides support for multiple output cam executionmodes.

The execution schedule operand 132 allows different execution schedulesto be selected that determine when an output cam block 14 (includingindividual cam profiles) associated with the output cam instruction 110is to be armed. The available execution schedules include immediate,pending, forward only, reverse only, and bi-directional. For theimmediate execution schedule, the output cam is armed immediately. Forthe pending execution schedule, the output cam is armed when the camposition of an armed output cam (i.e., a currently executing output cam)moves beyond its cam start or cam end position, thereby causing theoutput cam to be armed after execution of the currently executing outputcam is complete. For the forward only execution schedule, the output camis armed when the axis approaches or passes through the specified axisarm position in the forward direction. For the reverse only executionschedule, the output cam is armed when the axis approaches or passesthrough the specified axis arm position in the reverse direction. Forthe bi-directional execution schedule, the output cam is armed when theaxis approaches or passes through the specified axis arm position in theforward or reverse direction.

The execution schedule operand 132 therefore provides flexibility toselect different execution schedules, allowing the user to dynamicallyschedule profile changes to accommodate changes in product, machineoperation, and so on. The option to select a pending execution schedulein particular supports dynamic changes to cam operation. For example,some packaging machines are designed to support dynamic changes toproduct size. When the product size changes, the output cam profilestypically also change. With the execution schedule operand 132, theoutput cam can be armed immediately, or armed based on axis position anddirection (forward only, reverse only, or bi-directional), or armed whena currently executing output cam profile completes (pending). In thecase of a pending execution schedule, the arm output cam instruction 110is allowed to pend prior to product reaching a specified axis position,and then automatically arms when the current output cam instructioncompletes.

The axis arm position operand 134 defines the axis position where theoutput cam is armed, if the execution schedule operand 132 sets theexecution schedule to either forward only, reverse only, orbi-directional and the axis moves in the specified direction. The camarm position operand 136 defines the cam position that is associatedwith the axis arm position, when the output cam is armed. As describedbelow, cam element position is preferably maintained separately fromaxis position, and the delta position of the motion control axis ismonitored to ensure that the cam position moves at the same rate as theaxis position. Changes to the axis arm or cam arm position will onlytake effect at the execution of the arm output cam instruction 110.Operation of the axis arm position operand 134 and the cam arm positionoperand 136 is shown in FIG. 10.

The reference operand 138 allows a position reference to be selectedsuch that the output cam is connected to either the actual position ofan axis (as measured by a feedback device such as the feedback device46) or the command position of an axis (as commanded by a motioncontroller responsive to inputs from one of the motion blocks 18). Thus,the user is provided with the added flexibility to select actual orcommanded position reference when processing output cams. This isbeneficial during startup and shutdown when machines operate at veryslow speeds. During this time, output cam functionality is armed andoutputs are affected. Due to the slow speed, actual feedback jitteraffects cam operations by turning the outputs on/off multiple times asthe actual position moves through cam latch and unlatch positions. Thisis an undesirable behavior for many of the output devices controlled byoutput cams. Allowing the user to select commanded position as theoutput cam reference eliminates jitter in output devices, because acommanded position value does not experience feedback jitter to theextent that the actual feedback position value experiences jitter. As analternative, a built-in filter may be used to reduce jitter whenmonitoring actual position.

Referring again to FIG. 9, the disarm output cam instruction 150 willnow be described. The disarm output cam instruction 150 initiates thedisarming of one or more output cams connected to the specified axis.Based on the disarm type, the disarm output cam instruction 150 willdisarm either all output cams or only a specific output cam. Thecorresponding output devices 50 will maintain the last state after thedisarming. Alternatively, the last state after disarming may beuser-configurable.

The disarm output cam instruction 150 has the following operands: anaxis operand 152, an execution target operand 154, a motion controloperand 156, and a disarm type operand 158. The axis operand 152 of thedisarm output cam instruction 150 is similar to the axis operand 112 ofthe arm output cam instruction 110. The axis operand 152 specifies theposition input (one of the axis blocks 12) of the output cam block 14that is being disarmed. As described above, for execution by thecontroller module 40, the axis can be a servo, feedback only, physical,or consumed one. Likewise, for execution by the output cam module 52,the axis is a feedback axis and an axis assigned to the output cammodule 52.

The execution target operand 154 defines a specific output cam block 14from the set that is connected to the axis block 12 by the axis operand152. The execution target operand 154 of the disarm output caminstruction 150 is similar to the execution target operand 114 of thearm output cam instruction 110. Based on the value assigned theexecution target operand 154, the output cam block 14 is either anoutput cam block executed in the controller module 40 or in the outputcam module 52.

The motion control operand 156 stores status information duringexecution of the disarm output cam instruction. This informationincludes whether execution is in process, error information, and so on.The operand is another variable in the system 10 that can be examined byother parts of a user program used to provide initiation and run-timestatus information as the disarm output cam instruction 150 executes.

The disarm type operand 158 permits the disarm type to be selected.Depending on the selected disarm type, one or more output cam blocks 14are disarmed. The selected disarm type may be all, in which case alloutput cams connected to the axis block 12 specified by the axis operand152 are disarmed. The selected disarm type may also be specific, inwhich case a specific output cam block 14 connected to the axis block 12specified by the axis operand 152 and defined by the execution targetoperand 154 is disarmed.

2. Data Types

a. Output Cam Operand

The output cam operand 122 allows the latch and unlatch operation of theoutput cam element to be configured. Latching refers to the rising edgeof the cam element used to turn on an output bit. Unlatching refers tothe falling edge of the cam element used to turn off the output bit.

FIG. 11 is a block diagram showing the operation of the output cam block14 that takes into account the features provided by the output camoperand. As shown in FIG. 11, the output cam block 14 receives aposition input from the axis block 12. The output cam block 14 includeslatch and unlatch logic 160 and enable selection and inversion logic162. If no enable bit is used, then the latch and unlatch logic 160 doesnot receive an input from the enable selection and inversion logic 162.Rather, the latch and unlatch logic 160 controls latching and unlatchingof the specified output bit based on the parameters specified by a latchtype, a unlatch type, a left cam position, a right cam position, and aduration parameter (as applicable) specified in the output cam operand122. If an enable bit is used, then the latch and unlatch logic 160further receives an input from the enable selection and inversion logic162, as shown. The enable bit may be either one of the output bits inthe output block 16 (allowing dependencies between cam elements to beestablished) or may be an input bit 164 from elsewhere in the system 10(e.g., a sensor). In the event an enable bit is used, then an enabletype parameter and an enable bit parameter of the output cam operand 122is also used. These features will now be described in greater detail.

The output cam operand 122 is an array of output cam elements. As justindicated, the parameters specified by the output cam operand 122include an output bit, a latch type, an unlatch type, a left camposition, a right cam position, a duration, an enable type, and anenable bit.

The output bit is set to a value (e.g., from 0 to 31), corresponding tothe different output bits (e.g., thirty-two different bits) for whichthe output cam block 14 is responsible. Each cam element in the arrayhas an output bit parameter. The output bit is used to assign the camelement to a particular output bit.

The latch type describes the type of condition that is used to determinewhether the output bit is latched. The latch type may be set to one ofthe following conditions: inactive, position, enable, and position andenable. FIG. 12 shows the effect of the selected latch type on an outputbit for different compensated cam and enable bit combinations asfunction of position. If the latch type is set as inactive, thecorresponding output bit is not changed. Configuring the latch type asinactive allows another instruction (other than an output caminstruction) in the user application task to change the state of (turnon) the output bit. This allows the state of the output bit to bechanged directly by the application task, without using the output camblock 14. If the latch type is set as position, the corresponding outputbit is set when the axis enters compensated cam range (additionaldescription regarding the compensated cam range is contained below). Ifthe latch type is set as enable, the corresponding output bit is setwhen the enable bit becomes active. If the latch type is set as positionand enable, the corresponding output bit is set when the axis enters thecompensated cam range and the enable bit becomes active.

The unlatch type may be set to one of the following types of conditions:inactive, position, duration, enable, position and enable, duration andenable, and relative. FIG. 13 shows the effect of the selected unlatchtype on the output bit for different compensated cam and enable bitcombinations as function of position. FIG. 14 shows the effect of theselected unlatch type on the output bit for different compensated camand enable bit combinations as function of time. If the unlatch type isset as inactive, the corresponding output bit is not changed.Configuring the unlatch type as inactive allows a user application taskto change the state of (turn off) the output bit. If the unlatch type isset as position, the corresponding output bit is reset when the axisleaves the compensated output cam range. If the unlatch type is set asduration, the corresponding output bit is reset when the durationexpires. If the unlatch type is set as enable, the corresponding outputbit is reset when the enable bit becomes inactive. If the unlatch typeis set as position and enable, the corresponding output bit is resetwhen the axis leaves the compensated cam range or the enable bit becomesinactive. If the unlatch type is set as duration and enable, thecorresponding output bit is reset when the duration expires or theenable bit becomes inactive. If the unlatch type is set to relative, thecorresponding output bit is reset when the axis has moved apredetermined amount or delta position since the output bit wasinitially set.

The relative unlatch type allows the user to specify a position offsetfrom the latch operation in which to unlatch the cam element. Thisfeature may be useful in situations where, when an event is detected, anaction is to occur for a predetermined amount of axis travel. Forexample, the presence of a rejected part may cause a reject gate to openfor the next ten inches of axis travel. A photo-eye may then be used todetect the presence of the product because its position on the belt isnot guaranteed. The user then specifies in user units the distance theaxis will travel following the latch event in which the unlatch eventoccurs. In the above example, the user specifies the latch type as“enable” (the reject detect photo-eye) and the unlatch type as“relative.”

The left and right cam positions define the cam range of an output camelement. Specifically, if the latch or unlatch type is set to “position”or “position and enable” with the enable bit active, the left and rightcam positions specify the latch or unlatch position of the output bit.

The duration defines the duration of an output cam element.Specifically, if the unlatch type is set to “duration” or “duration andenable” with the enable bit active, the cam duration specifies the timebetween the latching and the unlatching of the output bit. For durationvalues, the user units may, for example, be seconds.

The enable type parameter is used when the latch type or the unlatchtype is set to enable. If the enable bit is based on one of the inputbits 164, then the enable type may be set to either non-inverted inputor inverted input. If the enable bit is based on one of the output bitsin the output block 16, then the enable type may be set to eithernon-inverted output or inverted output. The enable bit parameterspecifies which one of the input bits 164 (if the enable type parameterspecifies non-inverted input or inverted input) or which one of theoutput bits in the output block 16 (if the enable type parameterspecifies non-inverted output or inverted output) is used as an enablebit. If the enable bit is an input, the state of the input bit maycorrespond to the state of an input device (sensor) or to the state ofany other piece of data in the system 10. If the enable bit is an outputbit, the output state of the output bit may or may not be associatedwith a particular output device 50 coupled to the output block 16.

From the foregoing, a number of additional features may be apparent.First, the latch/unlatch operations may be controlled based on multipledifferent possible event states. For example, the user is permitted tocontrol latch/unlatch operations based on the state of an associatedenable bit. Thus, the user may specify the turn on (latch) behavior asposition and enable, and the turn off (unlatch) behavior as duration.The enable input can be any piece of I/O data that is available in thecontroller module 40 (or the output cam module 52). Thus, the enableinput may be received from any of a variety of different sensors (e.g.,a presence sensor to detect the presence of a production unit) and/orbased on information acquired from anywhere in the motion control system10. There is no need to provide a separate enable signal to thecontroller module 40 (or the output cam module 52). The ability tocontrol the latch/unlatch operations based on parameters other thaninput motor position provides flexibility.

Further, the ability to control latch/unlatch operations based on thestate of an associated enable bit also provides the user with theability to define dependencies between cam elements. Thus, the operatoris provided with the ability to condition the latch or unlatch operationof one cam element to the current output state of another cam elementassigned to another output bit. The source of an enable bit can beassigned to an output bit associated with another cam element. Thisallows the user to condition the latch or unlatch operation of one camelement to the current output state of another cam element assigned toanother output bit.

Another possible event state that a user may use to controllatch/unlatch operations is an event state determined by an applicationtask. Thus, the user may specify only the latch or unlatch operation ofa cam, and allocate the opposing operation to an application task bysetting the latch or unlatch type to inactive. For example, in a bottlefilling operation, it may be desirable for the filling operation tostart with the presence of a bottle when the machine is at a particularposition, and end when an application task determines that the bottle isfull. The user is permitted to specify a turn on (latch) operation oftype “position and enable” to actuate the filling process, and a turnoff (unlatch) operation of “inactive” allowing the user application tostop the filling process by turning the output bit off. Additionalbehaviors can be combined such as latching or unlatching based onposition and the state of an enable bit, and unlatching based on timeduration and the state of an enable bit.

Second, the user is provided with the ability to use multiple camelement assignments. No limitations are imposed (other than availablememory and performance) to the number of cam elements that can beassigned to each output bit. Therefore, each output bit may becontrolled as a function of multiple cam elements.

Third, the user has the ability to specify separate latch and unlatchoperations per cam element. For example, the user can specify the turnon (latch) behavior as position and enable, and the turn off (unlatch)behavior as duration.

Finally, the user has the ability to dynamically change cam element(latch, unlatch) behavior during operation of the motion control system10. The output cam instructions 110 and 150 are preferably executed in amulti-tasking environment which allows the controller module 40 toexamine the configuration data at each update cycle and implementschanges dynamically. The user may be permitted to change these valueseither programmatically or through an online data monitor. Thus, it ispossible to change cam element definitions independent of the arm outputcam instruction 110, for example, using other instructions in theprogramming interface, in response to user inputs using the on-line datamonitor, and so on. It is possible to do this while the motion controlaxis is moving and without reinitiating the arm output cam instruction.The user is permitted to change the value (e.g., the duration time, theleft and right position, and so on) or the type (e.g., from duration toposition and enable). This is valuable during system setup or when themotion control system 10 switches from one operation to another (e.g.,switches from handling one product to another). This allows the user tokeep the machine running when doing the changeover, which increasesproductivity. The controller module 40 is a multi-tasking system, andthe controller module 40 examines the configuration data at each updatecycle and implements changes dynamically.

b. Output Compensation Operand

By way of overview, the output compensation operand 128 allows offset,delay, and mode compensations to be defined and implemented for eachoutput bit. The parameters specified by the output compensation operand128 include an offset parameter, a latch delay parameter, an unlatchdelay parameter, a mode parameter, a pulse cycle time parameter, and apulse duty cycle parameter.

FIG. 15 is a block diagram showing the operation of the output cam block14 that takes into account the features provided by the outputcompensation operand. FIG. 15 is the same as FIG. 11, except that italso shows an offset and delay compensation block 170 and a modecompensation block 172, both of which are associated with the outputcompensation operand 128.

With regard to the offset and delay compensation block 170, and asdescribed in greater detail below, each output bit can have associatedwith it a position offset, a turn on (latch) time delay and a turn off(unlatch) time delay. The position offset allows the user to advance orretard all cam elements assigned to the output. Latch and unlatch timedelays permit the user to enter time delays to turn on/off an output bitsooner or later and thereby to take into account the fact that differentoutput devices may take different amounts of time to latch or unlatch.Again, it is possible to adjust these parameters independent of the armoutput cam instruction 110, for example, using other instructions in theprogramming interface, in response to user inputs using the on-line datamonitor, and so on, while the motion control axis is moving and withoutreinitiating the arm output cam instruction 110.

With regard to the mode compensation block 172, and as also described ingreater detail below, each output bit can have associated with it a modecompensation. As will be described below, depending on the modecompensation that is selected, latching and unlatching an output bit isnot necessarily the same as turning on and off the associated outputdevice 50. For example mode compensation may be implemented so as tocause an output bit to pulse in the latched state rather than remain on.Again, it is possible to adjust these parameters independent of the armoutput cam instruction 110, for example, using other instructions in theprogramming interface, in response to user inputs using the on-line datamonitor, and so on, while the motion control axis is moving and withoutreinitiating the arm output cam instruction 110.

In one embodiment, the blocks 160, 162, 170 and 172 are implementedusing control logic that includes one or more tables that store theinformation specified above as a separate entry for each cam element.For purposes of explanation, it is assumed that four tables are used,although it may be noted that in practice the tables may be combined,such as by combining the tables for blocks 160 and 162, and by combiningthe tables for the blocks 170 and 172.

As the motion control axis of the axis block 12 moves, the position ofthe axis is monitored and this information is provided to block 170. Foreach output bit, the table implemented in block 170 is accessed toprovide offset and delay compensation as described above. A compensatedlatch and unlatch position for each output bit is maintained.Preferably, delta position information for the motion control axis isemployed, and a cam position is defined which moves within the cam rangeat the same rate at which the axis position moves with the axis range ofmovement. The information from the block 170 is provided to the latchand unlatch block 160, and latch and unlatch operations are performed.The latched/unlatched state of each cam element is provided to the modecompensation block 172, which determines how the output device should becontrolled based on the latched/unlatched state of the cam element(e.g., normal, inverted, pulsed, and inverted and pulsed, as describedbelow).

(i) Offset and Delay Compensation

FIG. 16 shows the effect of the compensation values on an output camelement. As shown therein, the cam is defined by the left and right campositions of the output cam element. The compensated cam is defined bythe position offset and latch and unlatch offsets.

The offset parameter provides position compensation and may be specifiedin position units (e.g., user units). The position offset allows theuser to advance or retard all cam elements assigned to the output. Thelatch and unlatch delay parameter compensate for different latch/unlatchtimes of different types of output devices 50. Latch and unlatch timedelays may be entered as a float value in units of seconds. The latchand unlatch compensation provides speed and acceleration compensationfor the latch and separately for the unlatch operation. The user ispermitted to specify latch and unlatch time delays for particular outputdevices 50. The position compensation is then calculated based oncurrent velocity and acceleration as follows:

${{Latch}\mspace{14mu}{Offset}} = {{v*{Latch}\mspace{14mu}{Delay}} + {a*\frac{{Latch}\mspace{14mu}{Delay}^{2}}{2}}}$${{Unlatch}\mspace{14mu}{Offset}} = {{v*{Unlatch}\mspace{14mu}{Delay}} + {a*\frac{{Unlatch}{\mspace{11mu}\;}{Delay}^{2}}{2}}}$where v is the current axis speed and a is the axis acceleration, andLatchDelay and UnlatchDelay are values specified by the user for aparticular output device 50. The acceleration value a is continuouslyupdated (i.e., every update cycle). Preferably, the acceleration valueis filtered so as to obtain a smooth acceleration value which avoidsjitter. It is also possible to obtain the internal calculation of theacceleration and velocity command from the servo drive 42 and use thisvalue in the above equations. It may also be noted that it is possiblefor the user to specify either a positive or negative position offset ora negative position offset, as well as a positive delay or a negativedelay.

The following equation illustrates the effect of the compensation valueson the duration of an output cam element.Compensated Duration=Duration+Latch Delay−Unlatch Delay

From the foregoing, a number of additional features should be apparent.First, the latch compensation for a given output device 50 is separatelyconfigurable from the unlatch compensation for that output device 50such that compensation may be performed independently. Thus, theoperator has the ability to specify a turn-on compensation thataccurately reflects the turn-on delay of an output device 50 as well asa separate turn-off compensation that accurately reflects the turn-offdelay of the output device 50. Also, it is possible to configuredifferent latch and unlatch compensations for different output devices50. Thus, the operator is provided with the ability to specify differentturn-on compensations for different output devices 50 and/or the abilityto specify different turn-off compensations for different output devices50. Thus, it is possible to specify a latch delay and different unlatchdelay for a given output device 50, and also to specify differentlatch/unlatch delays for different output devices 50.

Second, it may also be noted that the compensations may be dynamicallyadjusted based on system conditions. For example, if an actuator beginsto wear causing an increase in the time required to turn it on, then theuser has the ability to dynamically change the position offset, latchdelay and unlatch delay for each output device 50 eitherprogrammatically or through an online data monitor. This avoids the needto shut down equipment to re-adjust, change the position of the outputdevice, or enter a new compensation delay value, which would requirestopping and restarting the process resulting in product waste. Also,all cam elements defined for a particular output bit may be affected atthe same time by making a change in one place, namely, the positionoffset parameter. Every cam element that is assigned to the output bitis offset by the same amount because each cam element uses the sameposition offset value.

Third, the system has the ability to adjust compensation based onvelocity and acceleration. During normal startup and shutdownprocedures, the customers packaging equipment will experience periods ofacceleration and deceleration while product is being processed. Cammingfunctions will occur during this time and the accuracy of the output isas important during accel/decel as it is during constant velocity. Thus,the ability to adjust for both velocity and acceleration improves systemoperation, for example, during normal startup and shutdown procedures.

Fourth, the compensation may be time-based or delta position-based.Because the delay in terms of time (as in the case of the latch/unlatchdelays), the compensation is independent of speed/acceleration. Outputdevices take a certain amount of time to actuate, and the actuation timeis the same regardless of the speed of the axis. Therefore, specifyingdelay in terms of time is easier because the speed of axis does not needto be taken into account.

(ii) Mode Compensation

Mode compensation allows the output devices 50 to be controlled so as tobehave in different ways depending on which mode of operation isselected. The output bit can have one of the following output modes:normal, inverted, pulsed, and inverted and pulsed. FIG. 17 shows theeffect of the mode, cycle time, and duty cycle on an output bit. In thenormal mode, the output bit is set, when the output of the latch andunlatch operation becomes active, and is reset when the output of thelatch and unlatch operation becomes inactive. In the inverted mode ofoperation, the output bit is set when the output of the latch andunlatch operation becomes inactive, and is reset when the output of thelatch and unlatch operation becomes active. In the pulsed mode ofoperation, the output bit is pulsed when the output of the latch andunlatch operation is active, and is reset when the output of the latchand unlatch operation becomes inactive. The on-duty state of the pulsecorresponds to the active state of the output bit. In the inverted andpulsed mode of operation, the output bit is pulsed when the output ofthe latch and unlatch operation is active, and is set when the output ofthe latch and unlatch operation becomes inactive. The on-duty state ofthe pulse corresponds to the inactive state of the output bit. If thepulsing mode of operation is selected then the cycle time and duty cycleparameters mentioned above are also used. Preferably, the user has theability to dynamically change the mode, cycle time, and duty cyclesettings. All cam elements associated with the output will behave thesame way.

The pulsing is preferably time-based so as not to be affected by axisspeed. In this arrangement, the pulse cycle time is specified as afloating point value in seconds, and the duty cycle is specified as apercent of on-time to off-time. The ability to pulse the output may beused in situations where it is necessary to perform an operation basedon a time-based pulsing pattern (e.g., a stitching process that appliesglue to produce a pattern of glue spots). The pulsing feature could alsobe used to simulate an analog output.

(iii) Position and Compensation Monitoring

As previously indicated, for each output bit of the output block 16, acurrent latch and unlatch position is maintained. This allows thecurrent latch and unlatch position to be compensated independently.Additionally, as previously mentioned, the user has the ability toassign multiple output cams to each output device 50. Theabove-described compensation applies for all the cams that are definedfor a given output device 50. As described above in connection with FIG.15, a cam table is used to track the compensated latch and unlatchpositions of the output bits of the output block 16 as compared to theposition of the motion control axis. Every time updated positioninformation is obtained, the cam table is scanned to determine which ifany output states need to be changed. The cam table is scanned everyupdate cycle and the compensated position is applied against the camtable, allowing the changes to be made dynamically.

Further, it is desirable to be able to maintain two different cam tablesat the same time for each output bit, at least in some instances. Aspreviously noted, it is possible to start a cam, execute the cam usingone cam profile, and then change the cam profile, and begin execution ofthe new cam profile with an execution schedule of pending. Because ofthe position compensation described above, there is not a “clean” breakbetween the two cam profiles. Different cams have different compensatedpositions, even if the uncompensated position is the same. Essentially,this means that two cam profiles may be operating simultaneously. Thus,a latch position may be using one cam table and one compensation table,and an unlatch position is using a different cam table and a differentcompensation table. An output bit may either be in the context of theactive cam, and its cam definition and its cam compensation andparameters, or in the context of the pending cam and its cam definitionand its compensation table. Therefore, the use of multiple compensationtables permits position to be tracked in different contexts, so that twocams may be supported while the cams are transitioning, and one cam (oroutput bit) is in one context and the other cam (or output bit) is inthe other context. As an alternative example, the latch position of oneoutput bit could be in the new context while the unlatch position ofthat output bit is still in the old context while the unlatch operationis finishing. One output bit may be in two different contexts or twodifferent cams (and two different cam profiles) at the same time. Onceall of the cam profiles have transitioned, the pending cam becomes theactive cam and the prior active cam terminates, and then only one camremains.

3. Overlapping Cams

Referring now to FIG. 18, FIG. 18 shows how two overlapping cam elementsfor an output may be handled. The overlapping cam elements may becombined producing one extended output cam. Multiple cams may thereforebe specified for an output bit and, if the cams are overlapping, nodiscontinuities are observed. As previously indicated, no limitationsare imposed, other than available memory and performance, to the numberof cam elements that can be assigned to each output bit.

4. Output Cam Editor

In the preferred embodiment, an output cam editor such as the output cameditor 190 shown in FIG. 19 is provided. The output cam editor 190provides an easy to use graphical user interface to edit and view outputcam arrays associated with the output cam operand 122. The output cameditor 190 comprises two different display regions or views 192, 194 anda toolbar 196. Each view 192, 194 is a different representation of thesame output cam array. The graph view 192 displays the output camprofiles as line graphs ordered by output bit. The graph view 192depicts rising and falling edges corresponding to the latch and unlatchoperations of individual cam elements as a function of position (or,alternatively, time). The graph view 192 is also usable (e.g., using amouse or keyboard to receive user inputs) to permit a user to redefineeach of the cam profiles by manipulating rising and falling edges in thecam profiles shown of the graphical representation.

The grid or tabular view 194 is a direct representation of the arraydata. The tabular view 194 provides a tabular representation of the camprofiles for the output bits, and comprises numeric and non-numericvalues describing the latch and unlatch operations of the cam elements.The toolbar 196 provides access to the Insert, Undo, Redo, Zoom-In,Zoom-Out, and Zoom-To-Fit command buttons. The output cam editor 190therefore presents output cam configuration data in both a tabular andgraphical form, providing an easier way to view and modify cam elementsfor each output bit.

The techniques described herein extend to those embodiments which fallwithin the scope of the appended claims, regardless of whether theyprovide any of the above-mentioned advantageous features.

Many changes and modifications may also be made to the invention withoutdeparting from the spirit thereof. The scope of these changes willbecome apparent from the appended claims.

1. A control method implemented by a microprocessor-based control system, comprising: monitoring a position of a motion control axis; controlling an output device responsive to the position of the motion control axis, including latching an electronic cam element that controls the output device, the cam element being implemented in a memory of the microprocessor-based control system, and unlatching the cam element that controls the output device; wherein a manner in which the latching is performed and a manner in which the unlatching is performed are configurable in a programming interface of the microprocessor-based control system; wherein the programming interface is capable of receiving a latch position for the cam element and an unlatch position for the cam element; wherein the programming interface is further capable of receiving additional configuration information to configure the manner in which the latching is performed and different additional configuration information to separately configure the manner in which the unlatching is performed; and wherein the latching and the unlatching are performed in the manner configured in the programming interface; wherein the controlling comprises: repeatedly changing the state of a cam element that controls the output device from a first state to a second state in response to a first condition being met, the first condition being specified as a parameter of an output cam instruction of a user program, and repeatedly changing the state of the cam element from the second state to the first state in response to a second condition being met; and repeatedly changing the state of a cam element that controls the output device from a first state to a second state in response to a first condition being met, the first condition being specified as a parameter of an output cam instruction of a user program is performed during execution of the output cam instruction, and the repeatedly changing the state of the cam element from the second state to the first state in response to a second condition being met is performed during execution of an instruction other than the output cam instruction.
 2. A method according to claim 1, wherein the programming interface is capable of adjusting the additional configuration information and the different additional configuration information, and initiating performance of the latching and unlatching in accordance with the adjusted additional configuration information and the different additional configuration information, during movement of the motion control axis.
 3. A method according to claim 1, wherein the programming interface receives the latch position and the unlatch position; and wherein the output device is latched at the latch position and unlatched at the unlatch position.
 4. A method according to claim 1, wherein the output device has only two output states including an on state and an off state, wherein controlling the output device comprises causing the output device to alternate between the on state and the off state, and wherein whether the output device is in the on state or the off state is determined at least in part by whether the cam element is latched or unlatched.
 5. A method according to claim 4, wherein the latching is performed in response to determining that the motion control axis is at a predetermined position.
 6. A method according to claim 1, wherein the controlling further comprises latching the cam element when the motion control axis is at a first position, determining that the position of the motion axis has changed by a predetermined amount, the predetermined amount being equal to a delta position value specified in a parameter of a user program, and unlatching the cam element in response to the determining, the cam element device being unlatched when the motion control axis is at a second position that is approximately equal to the first position plus the delta position value.
 7. A method according to claim 1, wherein the controlling is performed using an output cam instruction, and wherein the repeatedly changing the state of the cam element from the second state to the first state in response to a second condition being met is performed without reinitiating the output cam instruction.
 8. A method according to claim 1, wherein the additional configuration information includes a parameter that configures an output behavior of the output device as pulsed.
 9. A method according to claim 8, wherein the output cam instruction includes a parameter that permits a pulse cycle time of the output behavior to be configured.
 10. A method according to claim 9, wherein the output cam instruction includes a parameter that permits a pulse duty cycle of the output behavior to be configured.
 11. A control method implemented by a microprocessor-based control system, comprising: monitoring a position of a motion control axis; controlling a plurality of output devices responsive to the position of the motion control axis, including latching electronic cam elements that control the output devices, the cam elements being implemented in a memory of the microprocessor-based control system, and unlatching the cam elements that control the output devices; wherein a manner in which the latching is performed and a manner in which the unlatching is performed are configurable in a programming interface of the microprocessor-based control system; wherein the programming interface is capable of receiving a latch position for each of the cam elements; wherein the programming interface is further capable of receiving additional configuration information to separately configure the manner in which the latching is performed for each of the different cam elements; wherein the latching and the unlatching are performed in the manner configured in the programming interface; wherein the controlling comprises: repeatedly changing the state of a cam element that controls the output device from a first state to a second state in response to a first condition being met, the first condition being specified as a parameter of an output cam instruction of a user program, and repeatedly changing the state of the cam element from the second state to the first state in response to a second condition being met; and repeatedly changing the state of a cam element that controls the output device from a first state to a second state in response to a first condition being met, the first condition being specified as a parameter of an output cam instruction of a user program is performed during execution of the output cam instruction, and the repeatedly changing the state of the cam element from the second state to the first state in response to a second condition being met is performed during execution of an instruction other than the output cam instruction.
 12. A method according to claim 11, wherein the output devices each have only two output states including an on state and an off state, wherein controlling each of the output devices comprises causing the output device to alternate between the on state and the off state, and wherein whether the output device is in the on state or the off state is determined at least in part by whether the cam element is latched or unlatched.
 13. A method according to claim 12, wherein the latching is performed in response to determining that the motion control axis is at a predetermined position.
 14. A control method implemented by a microprocessor-based control system, comprising: monitoring a position of a motion control axis; controlling an output device responsive to the position of the motion control axis, including latching an electronic cam element that controls the output device and unlatching the cam element that controls the output device, the cam element being implemented in a memory of the microprocessor-based control system, and implementing a state change delay compensation, the state change delay compensation compensating for an amount of time required for the output device to change state after a control signal provided to the output device changes state, including determining a velocity and an acceleration of the motion control axis, and implementing the state change delay compensation as a function of the velocity and the acceleration of the motion control axis; wherein the controlling comprises: repeatedly changing the state of a cam element that controls the output device from a first state to a second state in response to a first condition being met, the first condition being specified as a parameter of an output cam instruction of a user program, and repeatedly changing the state of the cam element from the second state to the first state in response to a second condition being met; and repeatedly changing the state of a cam element that controls the output device from a first state to a second state in response to a first condition being met, the first condition being specified as a parameter of an output cam instruction of a user program is performed during execution of the output cam instruction, and the repeatedly changing the state of the cam element from the second state to the first state in response to a second condition being met is performed during execution of an instruction other than the output cam instruction.
 15. A method according to claim 14, wherein the output device has only two output states including an on state and an off state, wherein controlling the output device comprises causing the output device to alternate between the on state and the off state, and wherein whether the output device is in the on state or the off state is determined at least in part by whether the cam element is latched or unlatched.
 16. A method according to claim 15, wherein the latching is performed in response to determining that the motion control axis is at a predetermined position.
 17. A control method implemented by a microprocessor-based control system, comprising: monitoring a position of a motion control axis; and controlling an output device responsive to the position of the motion control axis, the controlling including latching a cam element that controls the output device and unlatching the cam element that controls the output device, the cam element being implemented in a memory of the microprocessor-based control system, and the controlling further including configuring a manner in which the controlling is performed according to a first configuration, performing the controlling in accordance with the first configuration, configuring the manner in which the controlling is performed according to a second configuration, performing the controlling in accordance with the second configuration; wherein performing the controlling in accordance with the first configuration, configuring the manner in which the controlling is performed according to a second configuration, and performing the controlling in accordance with the second configuration are performed during movement of the motion control axis; and wherein configuring a manner in which the controlling is performed according to a first configuration and configuring the manner in which the controlling is performed according to a second configuration are performed using configuration information received by way of a programming interface of the microprocessor-based control system.
 18. A method according to claim 17, wherein the first configuration and the second configuration are specified as user-configurable parameters of an output cam instruction, and wherein performing the controlling in accordance with the first condition and performing the controlling in accordance with the second configuration are performed without reinitiating the output cam instruction.
 19. A method according to claim 17, wherein the configuring the manner in which the controlling is performed according to a second configuration is performed in response to user inputs.
 20. A method according to claim 17, wherein the first configuration and the second configuration are specified as user-configurable parameters of an output cam instruction, and wherein the configuring the manner in which the controlling is performed according to a second configuration is performed by a user instruction other than the output cam instruction.
 21. A method according to claim 17, wherein the output device has only two output states including an on state and an off state, wherein controlling the output device comprises causing the output device to alternate between the on state and the off state, and wherein whether the output device is in the on state or the off state is determined at least in part by whether the cam element is latched or unlatched.
 22. A method according to claim 21, wherein the latching is performed in response to determining that the motion control axis is at a predetermined position.
 23. A control method implemented by a microprocessor-based control system, comprising: monitoring a position of a motion control axis; and controlling an output device responsive to the position of the motion control axis, including repeatedly changing a state of a cam element that controls the output device in response to a first state change condition being met, the cam element being implemented in a memory of the microprocessor-based control system, the first state change condition being a first condition under which the cam element changes state, changing from the first state change condition to a second state change condition during movement of the motion control axis, the second state change condition being a second condition under which the cam element changes state, and repeatedly changing a state of the cam element in response to the second state change condition being met; and wherein the first state change condition and the second state change condition are determined based on configuration information received by way of a programming interface of the microprocessor-based control system and wherein the output device has only two output states including an on state and an off state, wherein controlling the output device comprises causing the output device to alternate between the on state and the off state, and wherein whether the output device is in the on state or the off state is determined at least in part by whether the cam element is latched or unlatched.
 24. A method according to claim 23, wherein the first type is defined by motion axis position, and the second type is defined by at least one of cam element enablement status, elapsed time since latching, and change in motion axis position since latching.
 25. A method according to claim 23, wherein the latching is performed in response to determining that the motion control axis is at a predetermined position.
 26. A control method implemented by a microprocessor-based control system, comprising: monitoring a position of a motion control axis; and controlling an output device responsive to the position of the motion control axis, including repeatedly changing a state of a cam element that controls the output device in response to a first state change condition being met, the cam element being implemented in a memory of the microprocessor-based control system, the first state change condition being a first condition under which the cam element changes state, changing from the first state change condition to a second state change condition during movement of the motion control axis, the second state change condition being a second condition under which the cam element changes state, and repeatedly changing a state of the cam element in response to the second state change condition being met; and wherein the first state change condition and the second state change condition are determined based on configuration information received by way of a programming interface of the microprocessor-based control system and wherein the output device has two output states including an on state and an off state, wherein controlling the output device comprises causing the output device to alternate between the on state and the off state, and wherein whether the output device is in the on state or the off state is determined at least in part by whether the cam element is latched or unlatched.
 27. A method according to claim 26, wherein the controlling is performed using an output cam instruction, and wherein the changing is performed without reinitiating the output cam instruction.
 28. A method according to claim 26, wherein the latching is performed in response to determining that the motion control axis is at a predetermined position.
 29. A control method implemented by a microprocessor-based control system, comprising: monitoring a position of a motion control axis; controlling an output device responsive to the position of the motion control axis, including determining that the motion control axis is at a first predetermined position, latching a cam element that controls the output device responsive to the determination that the motion control axis is at the first predetermined position, the cam element is implemented in a memory of the microprocessor-based control system, determining that the position of the motion axis has changed by a predetermined amount, the predetermined amount being equal to a delta position value specified in a parameter of a user program, the delta position value being received by way of a programming interface of the microprocessor-based control system, and unlatching the cam element responsive to the determination that the motion control axis has changed by a predetermined amount, the cam element being unlatched when the motion control axis is at a second position that is approximately equal to the first predetermined position plus the delta position value wherein the controlling comprises: repeatedly changing the state of a cam element that controls the output device from a first state to a second state in response to a first condition being met, the first condition being specified as a parameter of an output cam instruction of a user program, and repeatedly changing the state of the cam element from the second state to the first state in response to a second condition being met; and repeatedly changing the state of a cam element that controls the output device from a first state to a second state in response to a first condition being met, the first condition being specified as a parameter of an output cam instruction of a user program is performed during execution of the output cam instruction, and the repeatedly changing the state of the cam element from the second state to the first state in response to a second condition being met is performed during execution of an instruction other than the output cam instruction.
 30. A method according to claim 29, wherein the output device has only two output states including an on state and an off state, wherein controlling the output device comprises causing the output device to alternate between the on state and the off state, and wherein whether the output device is in the on state or the off state is determined at least in part by whether the cam element is latched or unlatched.
 31. A method according to claim 30, wherein the latching is performed in response to determining that the motion control axis is at a predetermined position.
 32. A control method implemented by a microprocessor-based control system, comprising: monitoring a position of a motion control axis; controlling an output device responsive to the position of the motion control axis, including repeatedly changing the state of a cam element that controls the output device from a first state to a second state in response to a first condition being met, the first condition being specified as a parameter of an output cam instruction of a user program, and repeatedly changing the state of the cam element from the second state to the first state in response to a second condition being met; wherein the repeatedly changing the state of a cam element that controls the output device from a first state to a second state in response to a first condition being met, the first condition being specified as a parameter of an output cam instruction of a user program is performed during execution of the output cam instruction, and the repeatedly changing the state of the cam element from the second state to the first state in response to a second condition being met is performed during execution of a user instruction other than the output cam instruction; and wherein the user program may be displayed to a user using a programming interface of the microprocessor-based control system, wherein controlling the output device comprises latching a cam element that controls the output device and unlatching the cam element that controls the output device, the latching and unlatching of the cam element implementing the state changes of the cam element, and wherein the cam element is implemented in a memory of the microprocessor-based control system.
 33. A method according to claim 32, wherein the output device has only two output states including an on state and an off state, wherein controlling the output device comprises causing the output device to alternate between the on state and the off state, and wherein whether the output device is in the on state or the off state is determined at least in part by whether the cam element is latched or unlatched.
 34. A method according to claim 33, wherein the latching is performed in response to determining that the motion control axis is at a predetermined position.
 35. A control method implemented by a microprocessor-based control system, comprising: monitoring a position of a motion control axis; and controlling an output device responsive to the position of the motion control axis, the controlling step being performed in accordance with parameters specified in an output cam instruction of a user program, the output cam instruction including a parameter that configures an output behavior of the output device as pulsed; and wherein the user program may be displayed to a user using a programming interface of the microprocessor-based control system, wherein controlling the output device comprises latching a cam element that controls the output device and unlatching the cam element that controls the output device, and wherein the cam element is implemented in a memory of the microprocessor-based control system and wherein the output device has only two output states including an on state and an off state, wherein controlling the output device comprises causing the output device to alternate between the on state and the off state, and wherein whether the output device is in the on state or the off state is determined at least in part by whether the cam element is latched or unlatched.
 36. A method according to claim 35, wherein the output cam instruction includes a parameter that permits a pulse cycle time of the output behavior to be configured.
 37. A method according to claim 36, wherein the output cam instruction includes a parameter that permits a duty cycle of the output behavior to be configured.
 38. A method according to claim 35, wherein the latching is performed in response to determining that the motion control axis is at a predetermined position. 